module.exports = function(router){
	router.map({
		'/user': {
			name: 'user',
			forReady:true,//表示数据在ready请求
			component: require('./views/user.vue')
		},
		'/login': {
			name: 'login',
			forReady:true,//表示数据在ready请求
			component: require('./views/center/login.vue')
		},
		'/ready': {
			name: 'ready',
			forReady:true,//表示数据在ready请求
			component: require('./views/center/ready.vue')
		},
		'/getback': {
			name: 'getback',
			forReady:true,//表示数据在ready请求
			component: require('./views/center/getback.vue')
		},
		'/resetpass': {
			name: 'resetpass',
			forReady:true,//表示数据在ready请求
			component: require('./views/center/resetpass.vue')
		},
		'/register': {
			name: 'register',
			forReady:true,//表示数据在ready请求
			component: require('./views/center/register.vue')
		},
		'/drugstore': {
			name: 'drugstore',
			forReady:true,//表示数据在ready请求
			component: require('./views/drugstore.vue')
		},
		'/detail': {
			name: 'detail',
			forReady:true,//表示数据在ready请求
			component: require('./views/detail.vue')
		},
		'/vedio': {
			name: 'vedio',
			forReady:true,//表示数据在ready请求
			component: require('./views/vedio.vue')
		},
		'/vedioDetail': {
			name: 'vedioDetail',
			forReady:true,//表示数据在ready请求
			component: require('./views/vedioDetail.vue')
		},
		'/table': {
			name: 'table',
			forReady:true,//表示数据在ready请求
			component: require('./views/table.vue')
		},
		'/application': {
			name: 'application',
			forReady:true,//表示数据在ready请求
			component: require('./views/application.vue')
		},
		'/applicationDetail': {
			name: 'applicationDetail',
			forReady:true,//表示数据在ready请求
			component: require('./views/applicationDetail.vue')
		},
		'/appointment': {
			name: 'appointment',
			forReady:true,//表示数据在ready请求
			component: require('./views/appointment.vue')
		},
		'/goods': {
			name: 'goods',
			forReady:true,//表示数据在ready请求
			component: require('./views/goods.vue')
		},
		'/goodsDetail': {
			name: 'goodsDetail',
			forReady:true,//表示数据在ready请求
			component: require('./views/goodsDetail.vue')
		},
		'/order': {
			name: 'order',
			forReady:true,//表示数据在ready请求
			component: require('./views/order.vue')
		},
		'/physical': {
			name: 'physical',
			forReady:true,//表示数据在ready请求
			component: require('./views/physical.vue')
		},
		'/physicalDetail': {
			name: 'physicalDetail',
			forReady:true,//表示数据在ready请求
			component: require('./views/physicalDetail.vue')
		},
		'/users': {
			name: 'users',
			forReady:true,//表示数据在ready请求
			component: require('./views/users.vue')
		},
		'/usersDetail': {
			name: 'usersDetail',
			forReady:true,//表示数据在ready请求
			component: require('./views/usersDetail.vue')
		},
		'/background': {
			name: 'background',
			forReady:true,//表示数据在ready请求
			component: require('./views/background.vue')
		},
		'/backgroundDetail': {
			name: 'backgroundDetail',
			forReady:true,//表示数据在ready请求
			component: require('./views/backgroundDetail.vue')
		},
		'/drugorder': {
			name: 'drugorder',
			forReady:true,//表示数据在ready请求
			component: require('./views/drugorder.vue')
		},
		'/message': {
			name: 'message',
			forReady:true,//表示数据在ready请求
			component: require('./views/message.vue')
		},
		'/messageDetail': {
			name: 'messageDetail',
			forReady:true,//表示数据在ready请求
			component: require('./views/messageDetail.vue')
		},
		'/model': {
			name: 'model',
			forReady:true,//表示数据在ready请求
			component: require('./views/model.vue')
		},
		'/admin': {
			name: 'admin',
			forReady:true,//表示数据在ready请求
			component: require('./views/admin.vue')
		},
	});
	window.siteMap = {
		'/': '用户',
		'/login': '登陆',
		'/ready': '跳转等待',
		'/getback': '找回密码',
		'/resetpass': '重置密码',
		'/register': '注册',
		'/drugstore': '药店管理',
		'/detail': '详情',
		'/appointment': '预约管理',
		'/appointmentDetail': '预约详情',
		'/goods': '商品管理',
		'/goodsDetail': '商品详情',
		'/order': '订单管理',
		'/orderDetail': '订单详情',
		'/physical': '体检管理',
		'/physicalDetail': '体检详情',
		'/users': '用户管理',
		'/usersDetail': '用户详情',
		'/application': '应用管理',
		'/applicationDetail': '应用详情',
		'/background': '背景管理',
		'/backgroundDetail': '背景详情',
		'/drugorder': '药品订单',
		'/message': '消息管理',
		'/messageDetail': '消息管理详情',
		'/admin': '客户列表',
	};
	router.fn = typeof router.fn == 'Object'?router.fn:{};
	router.beforeEach(function (transition) {
		$("title").text(siteMap['/'+transition.to.name]);
		if (transition.to.name === 'userdetail') {
		}
		transition.next();
		if(typeof router.fn[transition.to.name] == 'function'){
			headerLoad();
			router.fn[transition.to.name]();
		}
	})
}
